//
//  CenterAction.m
//  GuShiNews
//
//  Created by huachun on 2019/8/16.
//  Copyright © 2019 Jones. All rights reserved.
//

#import "CenterAction.h"
#import "SettingController.h"
#import "NewsListController.h"
#import "MyFabuController.h"
#import "CommentController.h"
#import "AboutUsController.h"
#import "HiContactController.h"
#import "MyDataController.h"
#import "HiChangeNameController.h"
#import "ChangePasswardController.h"
#import "UserHomeController.h"

@implementation CenterAction

+(CenterAction *)Actiontodone:(SuperActionType)actiontype view:(id)view dictionary:(NSDictionary *)dictionary{
    CenterAction *action=[[CenterAction alloc] init:actiontype view:view dictionary:dictionary];
    return action;
}

-(instancetype)init:(SuperActionType)actiontype view:(id)view dictionary:(NSDictionary *)dictionary{
    self=[super init];
    if (self) {
        
        self.view = (UIViewController *)view;
        
        if (actiontype==JonesGOTO_CenterSetting) {
            
            SettingController *setting = [SettingController new];
            setting.hidesBottomBarWhenPushed=YES;
            [self.view.navigationController pushViewController:setting animated:YES];
            
        }
        else if (actiontype == JonesGOTO_CenterLike) {
            NewsListController *newslist = [NewsListController new];
            newslist.hidesBottomBarWhenPushed=YES;
            newslist.Type=0;
            [self.view.navigationController pushViewController:newslist animated:YES];
        }
        else if (actiontype == JonesGOTO_CenterHate) {
            NewsListController *newslist = [NewsListController new];
            newslist.hidesBottomBarWhenPushed=YES;
            newslist.Type=1;
            [self.view.navigationController pushViewController:newslist animated:YES];
        }
        else if (actiontype == JonesGOTO_CenterHistry) {
            NewsListController *newslist = [NewsListController new];
            newslist.hidesBottomBarWhenPushed=YES;
            newslist.Type=2;
            [self.view.navigationController pushViewController:newslist animated:YES];
        }
        else if (actiontype == JonesGOTO_CenterMydata) {
            MyFabuController *myfabu = [MyFabuController new];
            myfabu.hidesBottomBarWhenPushed=YES;
            [self.view.navigationController pushViewController:myfabu animated:YES];
        }
        else if (actiontype == JonesGOTO_CenterComment) {
            CommentController *newslist = [CommentController new];
            newslist.hidesBottomBarWhenPushed=YES;
            newslist.type = [dictionary objectForKey:@"type"];
            [self.view.navigationController pushViewController:newslist animated:YES];
        }
        else if (actiontype == JonesGOTO_CenterAboutUs) {
            AboutUsController *newslist = [AboutUsController new];
            newslist.hidesBottomBarWhenPushed=YES;
            [self.view.navigationController pushViewController:newslist animated:YES];
        }
        else if (actiontype == JonesGOTO_CenterContactUs) {
            HiContactController *newslist = [HiContactController new];
            newslist.hidesBottomBarWhenPushed=YES;
            newslist.type = 2;
            [self.view.navigationController pushViewController:newslist animated:YES];
        }
        else if (actiontype == JonesGOTO_CenterData) {
            MyDataController *mydata = [MyDataController new];
            mydata.hidesBottomBarWhenPushed=YES;
            [self.view.navigationController pushViewController:mydata animated:YES];
        }
        else if (actiontype == JonesGOTO_CenterName) {
            HiChangeNameController *changname = [HiChangeNameController new];
            changname.hidesBottomBarWhenPushed=YES;
            changname.usermodle = [dictionary objectForKey:@"model"];
            changname.Type = [[dictionary objectForKey:@"type"] integerValue];
            [self.view.navigationController pushViewController:changname animated:YES];
        }
        else if (actiontype == JonesGOTO_CenterPassward) {
            ChangePasswardController *passward = [ChangePasswardController new];
            passward.hidesBottomBarWhenPushed=YES;
            passward.usermodle = [dictionary objectForKey:@"model"];
            [self.view.navigationController pushViewController:passward animated:YES];
        }
        else if (actiontype == JonesGOTO_User_Center) {
            UserHomeController *usermodel = [UserHomeController new];
            usermodel.hidesBottomBarWhenPushed=YES;
            usermodel.Model = [dictionary objectForKey:@"model"];
            [self.view.navigationController pushViewController:usermodel animated:YES];
        }
//        else if (actiontype == HiGOTO_Center_MyOject) {
//            MyOjectController * likevc = [MyOjectController new];
//            likevc.hidesBottomBarWhenPushed=YES;
//            if ([dictionary objectForKey:@"model"]) {
//                likevc.Model = [dictionary objectForKey:@"model"];
//            }
//            if ([dictionary objectForKey:@"type"]) {
//                likevc.type = [dictionary objectForKey:@"type"];
//            }
//            [self.view.navigationController pushViewController:likevc animated:YES];
//        } else if (actiontype == HiGOTO_Center_MyRenzheng) {
//            AuthenticationController *likevc = [AuthenticationController new];
//            likevc.hidesBottomBarWhenPushed=YES;
//            [self.view.navigationController pushViewController:likevc animated:YES];
//        } else if (actiontype == HiGOTO_Center_MyRenjulebu) {
//            JuLeBuController *likevc = [JuLeBuController new];
//            likevc.hidesBottomBarWhenPushed=YES;
//            [self.view.navigationController pushViewController:likevc animated:YES];
//        } else if (actiontype == HiGOTO_Center_ChangeCity) {
//            ChooseCityController *cityvc = [ChooseCityController new];
//            if ([dictionary objectForKey:@"addmodel"]) {
//                cityvc.AddModel = [dictionary objectForKey:@"addmodel"];
//            }
//            cityvc.hidesBottomBarWhenPushed=YES;
//            [self.view.navigationController pushViewController:cityvc animated:YES];
//        } else if (actiontype == HiGOTO_Center_CarRenZheng) {
//            MyCarVerifyController *carrenzheng = [MyCarVerifyController new];
//            carrenzheng.hidesBottomBarWhenPushed=YES;
//            [self.view.navigationController pushViewController:carrenzheng animated:YES];
//        } else if (actiontype == HiGOTO_Center_SettingJone) {
//            JoneSettingController *settingzheng = [JoneSettingController new];
//            settingzheng.hidesBottomBarWhenPushed=YES;
//            settingzheng.Type = [[dictionary objectForKey:@"type"] integerValue];
//            [self.view.navigationController pushViewController:settingzheng animated:YES];
//        } else if (actiontype == HiGOTO_Center_ContactOur) {
//            HiContactController *ourcontact = [HiContactController new];
//            ourcontact.hidesBottomBarWhenPushed=YES;
//            ourcontact.type = [[dictionary objectForKey:@"type"] integerValue];
//            ourcontact.navigationItem.title= [dictionary objectForKey:@"tittle"];
//            [self.view.navigationController pushViewController:ourcontact animated:YES];
//        }
        
    }
    return self;
}


@end
